package com.example.yiwei.crm.view.frament.contactDetailedMenu;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.yiwei.crm.R;
import com.example.yiwei.crm.data.GetContact;
import com.example.yiwei.crm.entity.ContactMessageEntity;

/**
 * Created by Administrator on 2016/12/19.
 */

public class contactBaseFragment extends Fragment {
    @Nullable
    ContactMessageEntity contact;
    TextView txt_isFirstContact,txt_belogs_customer,txt_respectful,txt_job,txt_phone,txt_email,
            txt_zip_code,txt_address;
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View rootview=inflater.inflate(R.layout.fragment_contact_detailed_base,container,false);
        txt_address= (TextView) rootview.findViewById(R.id.fragment_contact_base_address);
        txt_belogs_customer= (TextView) rootview.findViewById(R.id.fragment_contact_base_blongs_to_customer);
        txt_email= (TextView) rootview.findViewById(R.id.fragment_contact_base_email);
        txt_isFirstContact= (TextView) rootview.findViewById(R.id.fragment_contact_base_main_contact);
        txt_zip_code= (TextView) rootview.findViewById(R.id.fragment_contact_base_zip_Code);
        txt_respectful= (TextView) rootview.findViewById(R.id.fragment_contact_base_respectful);
        txt_job= (TextView) rootview.findViewById(R.id.fragment_contact_base_respectful);
        txt_phone= (TextView) rootview.findViewById(R.id.fragment_contact_base_phone);

        contact=GetContact.get();
        int isFirstContact=contact.getIs_first_contact();
        if (isFirstContact==0){
            txt_isFirstContact.setText("否");
        }else if (isFirstContact==1){
            txt_isFirstContact.setText("是");
        }
        txt_belogs_customer.setText(contact.getFirst_contact_name());
        txt_respectful.setText(contact.getContact_respectful());
        txt_job.setText(contact.getContact_job());
        txt_phone.setText(contact.getContact_mobile_phone());
        txt_email.setText(contact.getContact_email());
        txt_zip_code.setText(contact.getContact_zip_code());
        txt_address.setText(contact.getContact_address());
        return rootview;
    }
}
